layer: revert to original form_cdi interface#15
Merged
sameo merged 1 commit intorivosinc:mainfrom Apr 21, 2025
Merged
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR reverts the form_cdi interface to its original form to simplify lifetime complexities based on the output slice’s lifetime. Key changes include updating the function signatures in Certificate methods to add an explicit buffer lifetime ('buf) with corresponding return types and adjusting the caller code in layer.rs accordingly.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/x509/certificate.rs | Updated Certificate functions to include a 'buf lifetime, change the certificate_buf parameter, and return a slice reference instead of unit. |
| src/layer.rs | Adjusted invocations of Certificate functions to align with the new signature changes. |
Comments suppressed due to low confidence (1)
src/x509/certificate.rs:209
- [nitpick] The 'certificate_buf' parameter now serves as an input/output buffer; consider renaming it (e.g., to 'buf' or 'cert_der_buf') to more clearly reflect its dual role.
certificate_buf: &'buf mut [u8],
After integrating with salus, it turns out having the second slice in simpler. The lifetime complexities that motivated the original charge are resolved by attaching the lifetime of the output slice to the input it is based on instead of `Self`. Signed-off-by: Dylan Reid <dgreid@rivosinc.com>
55ccabe to
d6edb43
Compare
sameo
approved these changes
Apr 21, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
After integrating with salus, it turns out having the second slice in simler. The lifetime complexities that motivated the original charge are resolved by attaching the lifetime of the output slice to the input it is based on instead of
Self.